<?php
/**
 * @Author: Marte
 * @Date:   2017-08-08 21:56:12
 * @Last Modified by:   Marte
 * @Last Modified time: 2017-08-21 22:25:26
 */
session_start();
if(!isset($_SESSION['username']))
{
    echo "<script>location='dl.php';</script>";
}
if(isset($_SESSION['username']))
{
    //如果已登录，则为1
    $_person=1;
}
else{
    // 否则未登录
    $_person=0;
    $_s=0;
}
if(isset($_GET['action']))
{
    $_s=$_GET['action'];
}else{
    $_s=1;
}

header('Content-Type:text/html;charset=utf-8');
include "data/config_connect.php";//导入数据库

$_username=$_SESSION['username'];
$_sql='select * from userregisters where username="'.$_username.'"';
$_result=$_mysql->query($_sql);
$_assoc=$_result->fetch_assoc();



?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <title>我的书架</title>
    <link rel="stylesheet" type="text/css" href="css/mybookrack.css">
     <script src="js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8" ></script>
    <script src="js/person.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
    <div class="header">
    <div class="header_main">
        <div class="header_main_left">
            <img src="images/personlogo2.png" alt="">
        </div>
        <div class="nav">
            <ul>
                <li class="first"><a href="person.php" title="">个人首页</a></li>
                <li class="active2"><a href="mybookrack.php" title="">朕的书架</a></li>
                <li class="active"><a href="messages.php" title="">消息中心</a></li>
                <li><a href="" title="">书荒区</a></li>
            </ul>
        </div>
        <div class="header_main_right">
            <ul>
                <li><a href="index.php" title="">墨轩首页</a></li>
            <?php
                    switch($_person)
                    {
                        case 0:echo '<li class="user"><a href="person.php" title="">个人中心</a></li>';
                        case 1:echo '<li class="user"><a href="person.php" title="">'.$_SESSION['username'].'</a></li>';
                    }
                ?>

                <div class="list"><ul>
                    <li><a href="person.php?change=2" title="">充值</a></li>
                    <li><a href="person.php?change=3" title="">个人设置</a></li>
                    <li><a href="" title="">联系客服</a></li>
                    <li><a href="person.php" title="">退出</a></li>
                </ul></div>
            </ul>

        </div>
    </div>


    <div class="main">
        <div class="main_left">
            <i><img src="<?php echo $_assoc['headicon'];?>" alt=""></i>
            <span class="host"><?php echo $_assoc['nickname'];?> <em><?php echo $_assoc['rank'];?></em></span>
            <span class="time">注册时间：<?php echo $_assoc['regtime'];?> </span>
            <hr />
            <ul>
                <li class="active"><a href="" title="">我的书架</a></li>
                <li><a href="allbooks.php" title="">   返回书城</a></li>
            </ul>
        </div>
        <div class="main_right">
            <span class="tui">书架推荐</span>
            <ul class="list">

                <li><a href="bookinfo.php?id=38" title=""><img src="http://dd.hlread.com/upload/book/57/57789.png" alt=""></a></li>
                <li><a href="bookinfo.php?id=40" title=""><img src="http://cdn.ikanshu.cn/211/images/60360832.jpg" alt=""></a></li>
                <li><a href="bookinfo.php?id=49" title=""><img src="http://img.17k.com/images/bookcover/2017/12490/62/2498066-1498617490000.jpg" alt=""></a></li>
                <li><a href="bookinfo.php?id=43" title=""><img src="http://cdn.ikanshu.cn/211/images/80001644.jpg" alt=""></a></li>
                <li><a href="bookinfo.php?id=48" title=""><img src="http://qidian.qpic.cn/qdbimg/349573/3596344/180" alt=""></a></li>
            </ul>
             <div class="clear">

            </div>
            <div class="wenzi">
                 <a href="bookinfo.php?id=38" title="">海边盛开的栀子花</a>
                <a href="bookinfo.php?id=40" title="">极品男仆</a>
                <a href="bookinfo.php?id=49" title="">三国大气象师</a>
                <a href="bookinfo.php?id=43" title="">美女图</a>
                <a href="bookinfo.php?id=48" title="">鬼医纨绔妃</a>
            </div>
            <div class="clear">

            </div>
            <span class="select s1"><a href="mybookrack.php?action=1" title="">朕的书架</a></span><span class="select s2"><em>|</em><a href="mybookrack.php?action=2" title="">我的下载</a></span>
            <span class="select s3"><a href="allbooks.php" title="">立即添加</a></span>
            <div class="content">

                <?php
                    switch($_s)
                    {
                        case 1:include 'include/mybookrack_select1.inc.php';break;
                        case 2:include 'include/mybookrack_select2.inc.php';break;
                        case 0:include 'include/mybookrack_select0.inc.php';break;
                    }
                ?>
            </div>

        </div>
    </div>
</body>
</html>
